﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects;

namespace SCMS.Model
{
    public static class AdvanceRequestExtensions
    {
        public static IQueryable<AdvanceRequest> IncludeCurrency(this IQueryable<AdvanceRequest> queryable)
        {
            return ((ObjectQuery<AdvanceRequest>)queryable).Include("Currency");
        }

        public static IQueryable<AdvanceRequest> IncludePaymentType(this IQueryable<AdvanceRequest> queryable)
        {
            return ((ObjectQuery<AdvanceRequest>)queryable).Include("PaymentType");
        }

        public static IQueryable<AdvanceRequest> IncludePaymentTerm(this IQueryable<AdvanceRequest> queryable)
        {
            return ((ObjectQuery<AdvanceRequest>)queryable).Include("PaymentTerm");
        }

        public static IQueryable<AdvanceRequest> IncludeStaff(this IQueryable<AdvanceRequest> queryable)
        {
            return ((ObjectQuery<AdvanceRequest>)queryable).Include("Staff.Person");
        }

        public static IQueryable<AdvanceRequest> IncludeStaffDesignation(this IQueryable<AdvanceRequest> queryable)
        {
            return ((ObjectQuery<AdvanceRequest>)queryable).Include("Staff.Designation");
        }

        public static IQueryable<AdvanceRequest> IncludeStaff1(this IQueryable<AdvanceRequest> queryable)
        {
            return ((ObjectQuery<AdvanceRequest>)queryable).Include("Staff1.Person");
        }

        public static IQueryable<AdvanceRequest> IncludeStaff1Designation(this IQueryable<AdvanceRequest> queryable)
        {
            return ((ObjectQuery<AdvanceRequest>)queryable).Include("Staff1.Designation");
        }

        public static IQueryable<AdvanceRequest> IncludeStaff2(this IQueryable<AdvanceRequest> queryable)
        {
            return ((ObjectQuery<AdvanceRequest>)queryable).Include("Staff2.Person");
        }

        public static IQueryable<AdvanceRequest> IncludeStaff2Designation(this IQueryable<AdvanceRequest> queryable)
        {
            return ((ObjectQuery<AdvanceRequest>)queryable).Include("Staff2.Designation");
        }

        public static IQueryable<AdvanceRequest> IncludeStaff3(this IQueryable<AdvanceRequest> queryable)
        {
            return ((ObjectQuery<AdvanceRequest>)queryable).Include("Staff3.Person");
        }

        public static IQueryable<AdvanceRequest> IncludeStaff3Designation(this IQueryable<AdvanceRequest> queryable)
        {
            return ((ObjectQuery<AdvanceRequest>)queryable).Include("Staff3.Designation");
        }

        public static IQueryable<AdvanceRequest> IncludeStaff4(this IQueryable<AdvanceRequest> queryable)
        {
            return ((ObjectQuery<AdvanceRequest>)queryable).Include("Staff4.Person");
        }

        public static IQueryable<AdvanceRequest> IncludeStaff4Designation(this IQueryable<AdvanceRequest> queryable)
        {
            return ((ObjectQuery<AdvanceRequest>)queryable).Include("Staff4.Designation");
        }

        public static IQueryable<AdvanceRequest> IncludeAdvanceRequestBudgetLines(this IQueryable<AdvanceRequest> queryable)
        {
            return ((ObjectQuery<AdvanceRequest>)queryable).Include("AdvanceRequestBudgetLines");
        }

        public static IQueryable<AdvanceRequestBudgetLine> IncludeProjectDonor(this IQueryable<AdvanceRequestBudgetLine> queryable)
        {
            return ((ObjectQuery<AdvanceRequestBudgetLine>)queryable).Include("ProjectBudget.BudgetCategory.ProjectDonor");
        }

        public static IQueryable<AdvanceRequestBudgetLine> IncludeProjectBudget(this IQueryable<AdvanceRequestBudgetLine> queryable)
        {
            return ((ObjectQuery<AdvanceRequestBudgetLine>)queryable).Include("ProjectBudget");
        }


        public static IQueryable<AdvanceRequestBudgetLine> IncludeAdvanceRequest(this IQueryable<AdvanceRequestBudgetLine> queryable)
        {
            return ((ObjectQuery<AdvanceRequestBudgetLine>)queryable).Include("AdvanceRequest");
        }
    }
}
